<template>
	<view class="guide">
		<u-navbar title="工匠入驻" :background="{background:'transparent'}" back-icon-color="#000" :border-bottom="false"
			title-color="#000"></u-navbar>
		<view class="f48 mt58 ml32 c692D34">
			师傅，您好
		</view>
		<view class="f48 mt24 ml32 c692D34">
			请选择您的入驻角色
		</view>
		<view class="f28 mt32 ml32">
			让我们为您提供更好的服务
		</view>
		<view class="img1 mt134" @click="valueRadio = 1" v-if="getAuthData.type !== 2 || getAuthData.status == 2">
			<view class="radio">
				<u-icon v-if="valueRadio == 1" name="checkbox-mark" color='#EB223C'></u-icon>
			</view>
		</view>
		<view class="img1 img2" @click="valueRadio = 2" v-if="getAuthData.type !== 1 || getAuthData.status == 2">
			<view class="radio">
				<u-icon v-if="valueRadio == 2" name="checkbox-mark" color='#EB223C'></u-icon>
			</view>
		</view>
		<view class="xybBox">
			<view class="xyb" @click="xyb">
				下一步
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				valueRadio: 1,
				getAuthData: {},
				type: null,
			}
		},
		onLoad(option) {

			if (option.type) {
				this.type = option.type
			}
			this.getAuth()
		},
		onShow() {
			// this.getAuth()
		},
		methods: {
			xyb() {
				if (this.valueRadio == 1) {
					this.$wanlshop.to('/pages/craftsman/craftsmanAdd?type=1')
					return
				}
				if (this.valueRadio == 2) {
					this.$wanlshop.to('/pages/craftsman/craftsmanAdd?type=2')
					return
				}

			},
			radioChange(i) {},
			getAuth() {
				this.$api.post({
					url: '/worker/user/getAuth',
				}).then(res => {
					console.log(res);
					if (res) {
						this.getAuthData = res
						this.valueRadio = res.type
						if (res.status && this.type != 'delete') {
							this.$wanlshop.to('/pages/craftsman/auditStatus')
						}
						// if (res.status == 0 && this.type != 'delete') {
						// 	this.$wanlshop.to('/pages/craftsman/auditStatus')
						// }
					}
					//状态:status0=待审核,1=审核通过,2=审核未通过
				})
			},
		},
	}
</script>

<style lang="scss" scoped>
	/* https: //img.aibbyp.com/wechatUser/category1/grdx.png
	https: //img.aibbyp.com/wechatUser/category1/jzdx.png */

	.guide {
		color: #692D34;
		width: 100%;
		height: 100vh;
		overflow: hidden;
		background-image: url('https://img.aibbyp.com/wechatUser/category1/gjrzbjc.png');
		background-size: 100% 532rpx;
		background-repeat: no-repeat;

	}

	.radioBox {
		padding: 0 20rpx;
	}

	.mt134 {
		margin-top: 134rpx;
	}

	.xybBox {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.xyb {
		margin-top: 102rpx;
		width: 568rpx;
		height: 98rpx;
		line-height: 98rpx;
		text-align: center;
		font-size: 40rpx;
		color: #FFFFFF;
		background: #FD5241;
		border-radius: 200rpx 200rpx 200rpx 200rpx;
	}

	.img1 {
		position: relative;
		margin-left: 40rpx;
		width: 670rpx !important;
		height: 200rpx;
		background-image: url('https://img.aibbyp.com/wechatUser/category1/grdx.png');
		background-size: 670rpx 200rpx;

		.radio {
			display: flex;
			align-content: center;
			justify-content: center;
			position: absolute;
			right: 40rpx;
			top: 80rpx;
			width: 40rpx;
			height: 40rpx;
			border: 2rpx solid #EB223C;
			border-radius: 50%;
		}

		/* background-repeat: no-repeat; */
	}

	.img2 {
		margin-top: 56rpx;
		background-image: url('https://img.aibbyp.com/wechatUser/category1/jzdx.png');
	}

	.f48 {
		font-size: 48rpx;
		font-weight: bold;
	}

	.mt58 {
		margin-top: 58rpx;
	}
</style>